﻿using MediatR;
using T.Vehicleservice.API.Application.Command.MaintenanceRecordCommand;
using T.Vehicleservice.Repository.ImpI;
using T.Vehicleservice.Repository.Interface;

namespace T.Vehicleservice.API.Application.CommandHandlers.MainCommandHandler
{
    public class MainCreateCommandHandler : IRequestHandler<MainCreateCommand, int>
    {
        protected readonly IMainIRepository mainIRepository;

        public MainCreateCommandHandler(IMainIRepository mainIRepository)
        {
            this.mainIRepository = mainIRepository;
        }

        public async Task<int> Handle(MainCreateCommand request, CancellationToken cancellationToken)
        {
            return await mainIRepository.AddAsync(request);
        }
    }




}
